/**
 */
package com.dingpeikeji.quickdeer.core.modules.orders.service;

import java.util.Date;
import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.dingpeikeji.quickdeer.core.common.persistence.Page;
import com.dingpeikeji.quickdeer.core.common.service.CrudService;
import com.dingpeikeji.quickdeer.core.modules.orders.dao.TOrdersOutDao;
import com.dingpeikeji.quickdeer.core.modules.orders.entity.TOrdersOut;

/**
 * 退款通知Service
 * @author isouland
 * @version 2016-07-14
 */
@Service
@Transactional(readOnly = true)
public class TOrdersOutService extends CrudService<TOrdersOutDao, TOrdersOut> {

	public TOrdersOut get(String outid) {
		return super.get(outid);
	}
	
	public List<TOrdersOut> findList(TOrdersOut tOrdersOut) {
		return super.findList(tOrdersOut);
	}
	
	public Page<TOrdersOut> findPage(Page<TOrdersOut> page, TOrdersOut tOrdersOut) {
		return super.findPage(page, tOrdersOut);
	}
	
	@Transactional(readOnly = false)
	public void save(TOrdersOut tOrdersOut) {
		if(tOrdersOut.getOutid() == null){
			tOrdersOut.setOuttime(new Date());
			dao.insert(tOrdersOut);
		} else {
			dao.update(tOrdersOut);
		}
	}
	
	@Transactional(readOnly = false)
	public void delete(TOrdersOut tOrdersOut) {
		super.delete(tOrdersOut);
	}
	
}
